//2009/08/20 01:06:26
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class Segments
{
public:
    string intersection(vector <int> s1, vector <int> s2)
    {
        int x1 = min(min(s1[0], s1[2]), min(s2[0],s2[2]));
        int x2 = max(max(s1[0], s1[2]), max(s2[0],s2[2]));
        int y1 = min(min(s1[1], s1[3]), min(s2[1],s2[3]));
        int y2 = max(max(s1[1], s1[3]), max(s2[1],s2[3]));

        int cont = 0;
        for (int i=x1; i<=x2; i++)
            for (int j=y1; j<=y2; j++)
                if (ison(s1, i, j) && ison(s2, i, j))
                    cont++;
        if (cont == 0) return "NO";
        if (cont == 1) return "POINT";
        return "SEGMENT";
    }
private:
    bool ison(vector<int> v, int x, int y)
    {
        return min(v[0], v[2])<=x && x <= max(v[0],v[2]) && min(v[1],v[3])<=y && y<=max(v[1],v[3]);
    }
};
